Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename minimum partition ID constant to be more generic #34529

Merged
merged 3 commits into from
May 20, 2024

Conversation

mariajgrimaldi
Copy link
Member

Description

Rename MINIMUM_STATIC_PARTITION_ID to MINIMUM_UNUSED_PARTITION_ID so it's not confusing when used to generate IDs for static or dynamic partitions.

Supporting information

See: #33788

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Apr 17, 2024
@openedx-webhooks
Copy link

Thanks for the pull request, @mariajgrimaldi! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

Copy link
Member

@kdmccormick kdmccormick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just one suggested comment improvement, to go with the name improvement.

@@ -17,7 +17,7 @@
# ID is stored in the xblock group_access dict).
ENROLLMENT_TRACK_PARTITION_ID = 50

MINIMUM_STATIC_PARTITION_ID = 100
MINIMUM_UNUSED_PARTITION_ID = 100
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# Each user partition has an ID that is unique within its learning context.
# The IDs must be valid MySQL primary keys, ie positive integers 1 -> 2^31-1.
# We must carefully manage these IDs, because once they are saved to OLX and the db, they cannot change.
# Here is how we delegate the ID range:
# * 1 -> 49: Unused/Reserved
# * 50: The enrollment track partition
# * 51: The content type gating partition (defined elsewhere)
# * 52-99: Available for other single user partitions, plugged in via setup.py.
#          Operators, beware of conflicting IDs between plugins!
# * 100 -> 2^31-1: General namespace for generating IDs at runtime.
#                  This includes, at least: content partitions, the cohort partition, and teamset partitions.
#                  When using this range, user partition implementations must check to see that they
#                  are not conflicting with an existing partition for the course.
ENROLLMENT_TRACK_PARTITION_ID = 50
MINIMUM_UNUSED_PARTITION_ID = 100

To make the new name clearer, I've rewritten the comment above. What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's much better! Thank you for all the suggestions.

@mariajgrimaldi mariajgrimaldi force-pushed the MJG/rename-min-partition-constant branch from d5fcea2 to 2d0b78b Compare April 17, 2024 17:08
@mphilbrick211
Copy link

Hi @kdmccormick! Is this something you can merge (if it's all set)?

@mariajgrimaldi
Copy link
Member Author

mariajgrimaldi commented May 16, 2024

@mphilbrick211: I can merge this early tomorrow.

EDIT: on Monday! 😅

Rename MINIMUM_STATIC_PARTITION_ID to MINIMUM_UNUSED_PARTITION_ID
so it's not confusing when used to generate IDs for static or dynamic
partitions.
@mariajgrimaldi mariajgrimaldi force-pushed the MJG/rename-min-partition-constant branch from 2d0b78b to 3b10d4c Compare May 17, 2024 15:24
@mariajgrimaldi mariajgrimaldi merged commit 33b8137 into master May 20, 2024
47 checks passed
@mariajgrimaldi mariajgrimaldi deleted the MJG/rename-min-partition-constant branch May 20, 2024 18:39
@openedx-webhooks
Copy link

@mariajgrimaldi 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants